<?php

class jwSocket extends BasejwSocket
{
    public function save(PropelPDO $con = null)
    {
        if ( $this->isNew() && !$this->getId() )
        {
            $c = new Criteria();
            $c->addAsColumn( 'greatest', "MAX(".jwSocketPeer::ID.")" );
            $c->setPrimaryTableName( jwSocketPeer::TABLE_NAME );
            $res = BasePeer::doSelect( $c );
            $count = $res->fetchColumn( 0 );
            $this->setId( ++$count );
        }
        parent::save( $con );        
    }
}
